﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfApplication1.Model;

namespace WpfApplication1.ViewModels
{
    public class MainViewModel: INotifyPropertyChanged
    {
        public const string CustomersPropertyName = "Customers";
        private ObservableCollection<Customer> _customers;
        public ObservableCollection<Customer> Customers
        {
            get { return _customers; }
            set { 
                if (_customers == value) 
                {
                    return;
                }
                _customers = value;
                RaisePropertyChanged(CustomersPropertyName);
            
            }
        
        
        
        }





















        public event PropertyChangedEventHandler PropertyChanged;

        public void RaisePropertyChanged(string propertyName) 
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            
            }
        
        }
    }
}
